import BaseStore from "@/base/BaseStore";
import React from "react";
import {Message} from "@biz/Components";

export default class Store extends BaseStore{
    constructor(props,config, action) {
        super(props, config, action)
        this.state = this.getInitialState()
    }

    getInitialSo() {
        return {
        }
    }

    onPreUpdateMqtt(vo){
        this.setState({detailStatus:"updateMqtt"});
        this.Action.getDetail(vo.id);
    }
    onUpdateMqtt(){
        this.setState({detailLoading:true});
    }
    onUpdateMqttCompleted(res){
        this.setState({detailLoading:false});
        super.dealCommonResponse(res,()=>{
            this.Action.cancel();
        })
    }

    onDoDeviceApi(){
        this.setState({loading:true});
    }
    onDoDeviceApiCompleted(res){
        this.setState({loading:false});
        this.dealResponse(res, () => {
            Message.success("请求已发起，若状态没有变化，请稍后刷新数据！");
           // setTimeout(()=>{
                super.refreshList();
           // },500)

        })
    }
}